<template>
  <!--registerhtmlStart-->
  <div class=" ub ub-ver ub-fv  ">
    <div></div>
    <div class=" ub-ac ub-pc ub  ud7290">
      <div></div>
      <div class="  ua77ab">
        <div>注册走起</div>
      </div>
    </div>
    <div class=" ub-f1 ub-ac ub ub-pc  u2336c">
      <div></div>
      <div class="  u8e407">
        <div></div>
        <div class=" ub ub-ac uinn  u0c426">
          <div></div>
          <div class=" tx-r ua24ac">
            <div>邮箱：</div>
          </div>
          <div class=" umar-l ub-f1  u17a97"><Input v-model="data.email" placeholder="请输入邮箱"></Input></div>
        </div>
        <div class=" ub ub-ac uinn  u0c426">
          <div></div>
          <div class=" tx-r  ua24ac">
            <div>密码：</div>
          </div>
          <div class=" umar-l ub-f1  u17a97"><Input v-model="data.password" placeholder="请输入密码" type="password"></Input>
          </div>
        </div>
        <div class=" ub ub-ac uinn  u0c426">
          <div></div>
          <div class=" tx-r  ua24ac">
            <div>确认密码：</div>
          </div>
          <div class=" umar-l ub-f1  u17a97"><Input v-model="data.password2" placeholder="与密码保持一致"
                                                    type="password"></Input></div>
        </div>
        <div class="  u887cf">
          <div></div>
          <div @click="ADregister()" class="  u7f28a">
            <Button type="success">注册</Button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!--registerhtmlEnd-->
</template>
<script>
  // interfaceCode
    import md5 from 'js-md5'
  var dftData = { // 注册成功还原数据
    email: '',
    password: '',
    code: 'gui',
    password2: ''
  }
  export default {
    name: '',
    components: {},
    data () {
      return {
        data: Object.assign({}, dftData),
        isLoading: false,
        msg: 'Welcome to Your Vue.js App'
      }
    },
    methods: {
      default (){
      }
      // methodsCode
      // BJdJpG0Mz Start
      ,
      ADregister() {
        if (this.isLoading === true) {
          return
        }
        var registerParam = this.data
        var passworder1 = registerParam.password
        var passworder2 = registerParam.password2
        if (passworder1 !== passworder2) {
          this.$gui.toast.error('两次密码输入不同,请重新输入')
          return
        }
        if (!passworder1) {
          this.$gui.toast.error('密码不能为空')
          return
        }
        var registerParam2 = Object.assign({}, registerParam) // 复制一个 避免双向绑定
        registerParam2.password = md5(registerParam.password)
        this.isLoading = true
        ADregister(registerParam2).then(data => { // 注册
          this.isLoading = false
          if (data) {
            this.$gui.toast.show('注册成功')
            this.data = Object.assign({}, dftData)
          }
        })
      }
      // BJdJpG0Mz end
    }
    ,
    computed: {}
  }
</script>
<style>
  .registercssStart {
  }

  html, body {
    height: 100%;
  }

  .ud7290 {
    height: 3.19em;
  }

  .u8e407 {
    height: 38.8em;
    width: 28.46em;
  }

  .ua24ac {
    width: 5.5em;
  }

  .u7f28a {
    margin-left: 0.6em;
  }

  .registercssEnd {
  }

  .registercssStart {
  }

  html, body {
    height: 100%;
  }

  .ud7290 {
    height: 3.19em;
  }

  .u8e407 {
    height: 38.8em;
  }

  .ua24ac {
    width: 5.5em;
  }

  .u7f28a {
    margin-left: 0.6em;
  }

  .registercssEnd {
  }

  /*cssStart*/

  /*cssEnd*/
</style>
